package learn.design.patterns.F_Proxy.Jdk;

import learn.design.patterns.F_Proxy.RealService;
import learn.design.patterns.F_Proxy.Service;

import java.lang.reflect.Proxy;

public class Test {
    public static void main(String[] args) {
        Service real = new RealService();
        Service proxy = (Service) Proxy.newProxyInstance(
                Service.class.getClassLoader(),
                new Class[]{Service.class},
                new MyInvocationHandler(real)
        );
        proxy.doSomething();
    }
}
